// pages/my/teacher/classManage/classManage.js
const app = getApp()
var base_url = app.globalData.url
Page({

  /**
   * 页面的初始数据
   */
  data: {
    mengban: "none",
    none:'none'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.getSystemInfo({

      success: function (res) {
        let clientHeight = res.windowHeight;
        let clientWidth = res.windowWidth;
        let ratio = 750 / clientWidth;
        let height = clientHeight * ratio;
        that.setData({
          height: clientHeight
        });
      }
    });
    wx.getStorage({
      key: 'classDatas_lst',
      success: function (res) {
        if (res.data.length == 0){
          that.setData({
            none: 'block'
          })
        }
        that.setData({
          classDatas_lst: res.data
        })

      },
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  deleteClass:function(){
    var that = this
    // wx.showModal({
    //   title: '您确定解散班级吗？',
    //   content: '注：解散班级后，班级所有学生将自动退出班级，解散班级前要提前对班级家长做好说明。',
    //   success: function (res) {
    //     if (res.confirm) {
    //       console.log('弹框后点确定')
    //     } else {
    //       console.log('弹框后点取消')
    //     }
    //   }
    // })
    that.setData({
      mengban: "block"
    })
  },
  createClass:function(){
    wx.navigateTo({
      url: '../createClass/createClass',
      success: function (res) {
        console.log(res)
      },
      fail: function () {
      }
    })
  },
  back: function () {
    this.setData({
      mengban: "none"
    })
  },
  sure: function () {
    this.setData({
      mengban: "none"
    })
  }
})